home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 52 / Amiga Format AFCD52 (Issue 136, May 2000).iso / -serious- / programming / basic / udp_chat / rexx / udp_chat.rexx < prev   
OS/2 REXX Batch file  |  2000-02-23  |  1KB  |  42 lines

  1. /* ARexx script to get UDP_Chat to log into a UDP_Chat Server */
  2. /* For use with AmiComSys 1.12+ */
  3. /* $VER: UDP_Chat.rexx 1.0 (27.07.98) Anton Reinauer */
  4.  
  5. UDP_CHAT ="UDP_Stuff:UDP_Chat"  
  6. UDP_CHAT_FIND ='WaitForPort UDP_Chat' 
  7.  
  8. /*  You have to change UDP_Chat to wherever UDP_Chat is on your hard drive
  9. as AmiComSys runs the Arexx script from it's directory :-/
  10. */ 
  11.  
  12. if ~show('P','UDP_Chat') then      /* check for the UDP_Chat arexx port */
  13.   do
  14.       ADDRESS COMMAND "C:Run <>NIL: " || UDP_CHAT 
  15.    end
  16.  
  17. /*  If UDP_Chat isn't already running, then run it.*/ 
  18.  
  19. ADDRESS AMICOMSYS;      /* Get info from AmiComSys */
  20. OPTIONS RESULTS;
  21.  
  22. GET stem info. CLIENTLIST;    /* get client info from AmicomSys*/
  23.  
  24. /* "stem info." inserts the results to the structure 'info.'. */
  25. /* "var s" would have inserted all the results to one string in s. */
  26. /* "CLIENTLIST": We want to read the client list information. */
  27.  
  28. s=info.selected;          /* get info from selected client*/
  29.  
  30. ADDRESS COMMAND UDP_CHAT_FIND  /* wait for the UDP_Chat Arexx port to appear*/
  31. IF RC = 0 THEN
  32.   do
  33.     ADDRESS "UDP_Chat"
  34.     CONNECTTOSERVER info.hostnames.s   /* Send host name of person selected 
  35.                         in list, to connect to. */
  36.   end
  37.  
  38. /* Send the host address got from AmiComSys and send it to UDP_Chat */
  39.  
  40.  
  41. EXIT;
  42.